import { iPb } from '@/protobuf/interface/index'

export const DbAdminMenuType = {
    [iPb.DbAdminMenuType.DbAdminMenuTypeDirectory]: {
        value: iPb.DbAdminMenuType.DbAdminMenuTypeDirectory,
        label: "目录"
    },
    [iPb.DbAdminMenuType.DbAdminMenuTypeMenu]:{
        value: iPb.DbAdminMenuType.DbAdminMenuTypeMenu,
        label: "菜单"
    },
    [iPb.DbAdminMenuType.DbAdminMenuTypeButton]:{
        value: iPb.DbAdminMenuType.DbAdminMenuTypeButton,
        label: "按钮"
    }
}
export const FuncDbAdminMenuType = (v: iPb.DbAdminMenuType) => {
    return DbAdminMenuType[v]
}

export const DbAdminProductCategoryState = {
    [iPb.DbAdminProductCategoryState.DbAdminProductCategoryStateDisabled]: {
        value: iPb.DbAdminProductCategoryState.DbAdminProductCategoryStateDisabled,
        label: "禁用",
        color: "#ff0000"
    },
    [iPb.DbAdminProductCategoryState.DbAdminProductCategoryStateEnabled]: {
        value: iPb.DbAdminProductCategoryState.DbAdminProductCategoryStateEnabled,
        label: "启用",
        color: "#389e0d"
    }
}
export const FuncDbAdminProductCategoryState = (v: iPb.DbAdminProductCategoryState) => {
    return DbAdminProductCategoryState[v]
}

export const DbAdminMenuState = {
    [iPb.DbAdminMenuState.DbAdminMenuStateDisabled]: {
        value: iPb.DbAdminMenuState.DbAdminMenuStateDisabled,
        label: "禁用"
    },
    [iPb.DbAdminMenuState.DbAdminMenuStateEnabled]: {
        value: iPb.DbAdminMenuState.DbAdminMenuStateEnabled,
        label: "启用"
    }
}
export const FuncDbAdminMenuState = (v: iPb.DbAdminMenuState) => {
    return DbAdminMenuState[v]
}

export const DbAdminMenuDisplay = {
    [iPb.DbAdminMenuDisplay.DbAdminMenuDisplayDisplay]: {
        value: iPb.DbAdminMenuDisplay.DbAdminMenuDisplayDisplay,
        label: "显示"
    },
    [iPb.DbAdminMenuDisplay.DbAdminMenuDisplayHidden]: {
        value: iPb.DbAdminMenuDisplay.DbAdminMenuDisplayHidden,
        label: "隐藏"
    }
}
export const FuncDbAdminMenuDisplay = (v: iPb.DbAdminMenuDisplay) => {
    return DbAdminMenuDisplay[v]
}


export const DbAdminState = {
    [iPb.DbAdminState.DbAdminStateDisabled]: {
        value: iPb.DbAdminState.DbAdminStateDisabled,
        label: "停用",
        color: "red"
    },
    [iPb.DbAdminState.DbAdminStateEnabled]: {
        value: iPb.DbAdminState.DbAdminStateEnabled,
        label: "正常",
        color: "blue"
    }
}
export const FuncDbAdminState = (v: iPb.DbAdminState) => {
    return DbAdminState[v]
}

export const DbAdminRoleState = {
    [iPb.DbAdminRoleState.DbAdminRoleStateDisabled]: {
        value: iPb.DbAdminRoleState.DbAdminRoleStateDisabled,
        label: "停用",
        color: "red"
    },
    [iPb.DbAdminRoleState.DbAdminRoleStateEnabled]: {
        value: iPb.DbAdminRoleState.DbAdminRoleStateEnabled,
        label: "正常",
        color: "blue"
    }
}
export const FuncDbAdminRoleState = (v: iPb.DbAdminRoleState) => {
    return DbAdminRoleState[v]
}



export const DbMemberState = {
    [iPb.DbMemberState.DbMemberStateDisabled]: {
        value: iPb.DbMemberState.DbMemberStateDisabled,
        label: "禁用",
        color: "red"
    },
    [iPb.DbMemberState.DbMemberStateNotActive]: {
        value: iPb.DbMemberState.DbMemberStateNotActive,
        label: "未激活",
        color: "blue"
    },
    [iPb.DbMemberState.DbMemberStateNormal]: {
        value: iPb.DbMemberState.DbMemberStateNormal,
        label: "正常",
        color: "green"
    }
}
export const FuncDbMemberState = (v: iPb.DbMemberState) => {
    return DbMemberState[v]
}


export const DbArticleState = {
    [iPb.DbArticleState.DbArticleStateDisabled]: {
        value: iPb.DbArticleState.DbArticleStateDisabled,
        label: "停用",
        color: "red"
    },
    [iPb.DbArticleState.DbArticleStateEnabled]: {
        value: iPb.DbArticleState.DbArticleStateEnabled,
        label: "正常",
        color: "blue"
    }
}
export const FuncDbArticleState = (v: iPb.DbArticleState) => {
    return DbArticleState[v]
}

export const DbArticleTopUp = {
    [iPb.DbArticleTopUp.DbArticleTopUpNo]: {
        value: iPb.DbArticleTopUp.DbArticleTopUpNo,
        label: "否",
        color: "red"
    },
    [iPb.DbArticleTopUp.DbArticleTopUpYes]: {
        value: iPb.DbArticleTopUp.DbArticleTopUpYes,
        label: "是",
        color: "blue"
    }
}
export const FuncDbArticleTopUp = (v: iPb.DbArticleTopUp) => {
    return DbArticleTopUp[v]
}

export const DbArticleGroupState = {
    [iPb.DbArticleGroupState.DbArticleGroupStateDisabled]: {
        value: iPb.DbArticleGroupState.DbArticleGroupStateDisabled,
        label: "停用",
        color: "red"
    },
    [iPb.DbArticleGroupState.DbArticleGroupStateEnabled]: {
        value: iPb.DbArticleGroupState.DbArticleGroupStateEnabled,
        label: "正常",
        color: "blue"
    }
}
export const FuncDbArticleGroupState = (v: iPb.DbArticleGroupState) => {
    return DbArticleGroupState[v]
}


export const DbMemberWalletTransactionType = {
    [iPb.DbMemberWalletTransactionType.DbMemberWalletTransactionTypeChange]: {
        value: iPb.DbMemberWalletTransactionType.DbMemberWalletTransactionTypeChange,
        label: "直接变更",
        color: "green"
    },
    [iPb.DbMemberWalletTransactionType.DbMemberWalletTransactionTypeIncrease]: {
        value: iPb.DbMemberWalletTransactionType.DbMemberWalletTransactionTypeIncrease,
        label: "增加",
        color: "blue"
    },
    [iPb.DbMemberWalletTransactionType.DbMemberWalletTransactionTypeDecrease]: {
        value: iPb.DbMemberWalletTransactionType.DbMemberWalletTransactionTypeDecrease,
        label: "扣除",
        color: "red"
    }
}
export const FuncDbMemberWalletTransactionType = (v: iPb.DbMemberWalletTransactionType) => {
    return DbMemberWalletTransactionType[v]
}